let path = require('path')
 let apiConfig=require('./config.js')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? '/jjc/' : '/',
  lintOnSave: false,
  productionSourceMap: false,
  devServer: {
    host:'0.0.0.0',
    disableHostCheck: true,
    port:8081,
    proxy: {
      '/api': {
        target: apiConfig.apiHost,
        changeOrigin: true,
        pathRewrite: {
          '/api': ''
        }
      }
    }
  },
  css: {
    loaderOptions: {
      stylus: {
        import: path.resolve(__dirname, './src/assets/styles/varibles.styl')
      }
    }
  },
  chainWebpack: config=>{
    config.resolve.alias
      .set('@',resolve('src'))
      .set('plugins', resolve('src/plugins'))
      .set('views', resolve('src/views'))
      .set('images', resolve('src/assets/images'))
      .set('components', resolve('src/components'))  
  }
}